<?php

$article = $this->article;

?>
<h3><?php echo $this->escape($article->title) ?></h3>
<p class="meta">
	Publicado por
	<a href="<?php echo $this->escape($article->authorEmail) ?>"><?php echo $this->escape($article->authorName) ?></a>,
	el <?php echo $this->escape($article->publishedAt->toString('MMMM d YYYY')) ?>
</p>
<div class="content"><?php echo $article->content ?></div>
<p class="share"><img alt="" height="16" src="/media/site/images/mail_icon.png" width="16" /> <a href="/articles/share?articleSlug=<?php echo $this->escape($article->slug) ?>" target="_blank">Compartir con un amigo</a></p>
<div class="comments">
	<hr/>
	<p class="float-right"><a href="#comment-form">Comentar este evento &raquo;</a></p>
	<h4>Comentarios</h4>
	<ul id="comment-list">
<?php
$i = 0;
foreach ($this->articleComments as $comment) {
	if('' != $comment->userPicture)
		$picture = BASE_URL . '/uploads/users/' . $user->picture;
	else
	{
		$picture = 'http://www.gravatar.com/avatar.php?default=identicon&size=64&gravatar_id='
			. md5(strtolower($comment->authorEmail));
	}
?>
		<li class="comment<?php echo ($i == 0 ? ' first' : ''), (($i % 2) == 0 ? ' even' : ' odd') ?>">
			<table style="width:100%">
				<tr>
					<td rowspan="2" style="width:74px"><img alt="" height="64" src="<?php echo $this->escape($picture) ?>" width="64"></td>
					<td>
						<h4><?php echo $this->escape($comment->authorName) ?></h4>
					</td>
					<td style="text-align:right"><?php echo strftime('%Y-%m-%d', strtotime($comment->publishedAt)) ?></td>
				</tr>
				<tr>
					<td colspan="2"><?php echo $this->escape($comment->content) ?></td>
				</tr>
			</table>
		</li>
<?php
	++$i;
}
?>
	</ul>

	<div id="comment-form">
		<?php echo $this->commentForm ?>
	</div>
</div>
